package bubbleFishBob.game;

import java.awt.Color;
import java.awt.Graphics2D;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

import bubbleFishBob.gameobjects.Fish;

import com.golden.gamedev.Game;
import com.golden.gamedev.object.Background;
import com.golden.gamedev.object.PlayField;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.SpriteGroup;
import com.golden.gamedev.object.background.ColorBackground;
import com.golden.gamedev.object.background.ImageBackground;

public class Level extends AbstractLevel
{

    private final boolean isStarted = false;

    private final List<Sprite> bubbles = new ArrayList<Sprite>();
    private final String LEVEL_RESOURCE = "bubbleFishBob/resources/paths/Level1Pathpoints.txt";
    
    
    private Fish myFish;

    public PlayField playField = new PlayField(new ColorBackground(Color.white));

    public Level(Game game)
    {
        super(game);

        myFish = new Fish(game, new File(
                "bin/bubbleFishBob/resources/images/FishImages"));

        Background background = new ImageBackground(
                game.getImage("bubbleFishBob/resources/images/background/seagrass.jpg"));
        playField.setBackground(background);
        playField.add(myFish);
        SpriteGroup projectileGroup = myFish.getProjectileGroup();
        playField.addGroup(projectileGroup);
    }

    public Level(Game game, File file)
    {
        super(game, file);
    }

    /**
     * Renders all sprites
     * 
     * @param g
     */
    @Override
    public void render(Graphics2D g)
    {
        playField.render(g);
    }

    /**
     * Updates state of sprites in path
     * 
     * @param elapsedTime
     */
    @Override
    public void update(long elapsedTime)
    {

        playField.update(elapsedTime);
    }

}
